import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: '/table_items',
        method: 'get',
        params: query
    });
};

export const deleteTableItem = id => {
    return request({
        url: '/table_items/' + id,
        method: 'delete',
    });
};

export const updateTableItem = (id, data) => {
    return request({
        url: '/table_items/' + id,
        method: 'patch',
        data: data,
    });
};

export const addTableItem = (data) => {
    return request({
        url: '/table_items',
        method: 'post',
        data: data,
    });
};